package com.training.content.service.impl;

import java.util.List;
import com.training.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.training.content.mapper.ExamSubjectMapper;
import com.training.content.domain.ExamSubject;
import com.training.content.service.IExamSubjectService;

/**
 * 试卷题目Service业务层处理
 * 
 * @author training
 * @date 2021-10-25
 */
@Service
public class ExamSubjectServiceImpl implements IExamSubjectService 
{
    @Autowired
    private ExamSubjectMapper examSubjectMapper;

    /**
     * 查询试卷题目
     * 
     * @param subjectId 试卷题目主键
     * @return 试卷题目
     */
    @Override
    public ExamSubject selectExamSubjectBySubjectId(Long subjectId)
    {
        return examSubjectMapper.selectExamSubjectBySubjectId(subjectId);
    }

    /**
     * 查询试卷题目列表
     * 
     * @param examSubject 试卷题目
     * @return 试卷题目
     */
    @Override
    public List<ExamSubject> selectExamSubjectList(ExamSubject examSubject)
    {
        return examSubjectMapper.selectExamSubjectList(examSubject);
    }

    /**
     * 新增试卷题目
     * 
     * @param examSubject 试卷题目
     * @return 结果
     */
    @Override
    public int insertExamSubject(ExamSubject examSubject)
    {
        examSubject.setCreateTime(DateUtils.getNowDate());
        return examSubjectMapper.insertExamSubject(examSubject);
    }

    /**
     * 修改试卷题目
     * 
     * @param examSubject 试卷题目
     * @return 结果
     */
    @Override
    public int updateExamSubject(ExamSubject examSubject)
    {
        examSubject.setUpdateTime(DateUtils.getNowDate());
        return examSubjectMapper.updateExamSubject(examSubject);
    }

    /**
     * 批量删除试卷题目
     * 
     * @param subjectIds 需要删除的试卷题目主键
     * @return 结果
     */
    @Override
    public int deleteExamSubjectBySubjectIds(Long[] subjectIds)
    {
        return examSubjectMapper.deleteExamSubjectBySubjectIds(subjectIds);
    }

    /**
     * 删除试卷题目信息
     * 
     * @param subjectId 试卷题目主键
     * @return 结果
     */
    @Override
    public int deleteExamSubjectBySubjectId(Long subjectId)
    {
        return examSubjectMapper.deleteExamSubjectBySubjectId(subjectId);
    }
}
